package com.webapp.model;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Message {

	private int messageId;
	private String date;
	private String subject;
	private String content;
	private int sender;
	private int reciever;
	
	public Message(String sub, String cont, int send, int rec){
		messageId = new Double( Math.random() * 100000 ).intValue();
		subject = sub;
		content = cont;
		sender = send;
		reciever = rec;
	
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		Calendar cal = Calendar.getInstance();
		date = dateFormat.format(cal.getTime());
	}
	
	public Message(int mess, String dater, String sub, String cont, int send, int rec){
		messageId = mess;
		date = dater;
		subject = sub;
		content = cont;
		sender = send;
		reciever = rec;
	}
	
	public int getMessageId(){return messageId;}
	public String getDate(){return date;}
	public String getSubject(){return subject;}
	public String getContent(){return content;}
	public int getSender(){return sender;}
	public int getReciever(){return reciever;}
	
	public void setMessageId(int message){this.messageId = message;}
	public void setDate(String dater){this.date = dater;}
	public void setSubject(String sub){this.subject = sub;}
	public void setContent(String con){this.content = con;}
	public void setSender(int send){this.sender = send;}
	public void setReciever(int recieve){this.reciever = recieve;}
}
